package org.lyq.erp.process.freight.controller;

import javax.annotation.Resource;
import org.lyq.erp.config.json.JSONResult;
import org.lyq.erp.process.freight.pojo.TblWxFreights;
import org.lyq.erp.process.freight.service.TblWxFreightsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping({ "/TblWxFreights" })
public class TblWxFreightsController {
	@Resource
	private TblWxFreightsService tblWxFreightsService;

	@RequestMapping({ "/updateFreights" })
	@ResponseBody
	public JSONResult updateFreights(TblWxFreights tblWxFreights) {
		if (tblWxFreights.getFreightId() != null) {
			try {
				this.tblWxFreightsService.updateFreighByFreightId(tblWxFreights);
			} catch (Exception e) {
				return JSONResult.errorMsg("freight002");
			}
			return JSONResult.errorMsg("freight001");
		}
		return JSONResult.errorMsg("freight002");
	}
}
